class Cleaner:
    @staticmethod
    def gather_by_key(list, group, count):
        """
        :param list:  dic list
        :param group: key to identify
        :param count: item quantity per key
        :return: new dic list just contain ...
        """
        loop_keys = []
        result = []

        for index, item in enumerate(list):
            if item[group] not in loop_keys:
                loop_keys.append(item[group])
                magazine = 0
                for record in list:
                    if magazine < count:
                        if record[group] == item[group]:
                            result.append(record)
                            magazine += 1
                    else:
                        break

        return result